var Fight,
  __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (t, n) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, t) {
              e.__proto__ = t;
            }) ||
          function (e, t) {
            for (var n in t)
              Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
          })(t, n);
      };
      return function (t, n) {
        function o() {
          this.constructor = t;
        }
        if ("function" != typeof n && null !== n)
          throw new TypeError(
            "Class extends value " + String(n) + " is not a constructor or null"
          );
        e(t, n),
          (t.prototype =
            null === n
              ? Object.create(n)
              : ((o.prototype = n.prototype), new o()));
      };
    })();
!(function (e) {
  var t = (function (e) {
    function t(n) {
      var o = e.call(this) || this;
      (o.lw = 90), (o.lh = 26), (o.second = 0);
      var a = n,
        i = a / t.WIDTH,
        l = i * t.HEIGHT;
      o.size(a, 2 * l);
      var r = (l - o.lh) / 2,
        s = new Laya.Image("fight/bg.png");
      s.size(a, l), o.addChild(s);
      var f = new Laya.Label("第 \b1 回");
      return (
        f.size(o.lw, o.lh),
        (f.fontSize = 16),
        (f.color = "#ff0000"),
        (f.bold = !0),
        (f.align = "center"),
        (f.valign = "middle"),
        f.pos((a - o.lw) / 2, r),
        (o.roundLabel = f),
        o.addChild(f),
        (f = new Laya.Label("敌 方")).size(o.lw, o.lh),
        (f.fontSize = 14),
        (f.color = "#ffffff"),
        (f.bold = !0),
        (f.align = "center"),
        (f.valign = "middle"),
        f.pos((a / 3 - o.lw) / 2 - 5, r),
        (o.enemyLabel = f),
        o.addChild(f),
        (f = new Laya.Label(Global.roleName)).size(o.lw, o.lh),
        (f.fontSize = 14),
        (f.color = "#ffffff"),
        (f.bold = !0),
        (f.align = "center"),
        (f.valign = "middle"),
        f.pos((5 * a) / 6 - o.lw / 2, r),
        (o.myLabel = f),
        o.addChild(f),
        (s = new Laya.Image("fight/btn_bg.png")).size(282 * i, 68 * i),
        s.pos((a - 282 * i) / 2, l),
        o.addChild(s),
        (f = new Laya.Label("出招（60）")).size(o.lw + 20, o.lh),
        (f.fontSize = 16),
        (f.color = "#ffffff"),
        (f.align = "center"),
        (f.valign = "middle"),
        f.pos((a - o.lw - 20) / 2, r + l),
        (o.secondLabel = f),
        o.addChild(f),
        (f = new Laya.Label()).size(o.lw + 40, o.lh),
        (f.fontSize = 14),
        (f.color = "#ffffff"),
        (f.align = "center"),
        (f.valign = "middle"),
        f.pos((a - o.lw - 40) / 2, r + l + o.lh + 4),
        (f.visible = !1),
        (f.alpha = 0),
        (o.toastLabel = f),
        o.addChild(f),
        o
      );
    }
    return (
      __extends(t, e),
      (t.prototype.setTime = function (e) {
        (this.second = e), Laya.timer.loop(1e3, this, this.setSecond);
      }),
      (t.prototype.setRound = function (e) {
        this.roundLabel.text = "第 " + e + " 回";
      }),
      (t.prototype.setSecond = function () {
        var e = this.second - 1;
        e < 0
          ? Laya.timer.clear(this, this.setSecond)
          : 3 != e
          ? ((this.secondLabel.text = "出招（" + e + "）"), (this.second = e))
          : this.parent.event("FightButton", "timeout");
      }),
      (t.prototype.setText = function (e) {
        Laya.timer.clear(this, this.setSecond), (this.secondLabel.text = e);
      }),
      (t.prototype.setEnemyName = function (e) {
        this.enemyLabel.text = e;
      }),
      (t.prototype.setMyName = function () {
        this.myLabel.text = Global.roleName;
      }),
      (t.prototype.setToast = function (e, t) {
        var n = this.toastLabel;
        (n.text = e),
          (n.visible = !0),
          (n.alpha = 1),
          Laya.timer.once(1e3 / t, this, function () {
            Laya.Tween.to(n, { alpha: 0 }, 300 / t);
          });
      }),
      (t.WIDTH = 750),
      (t.HEIGHT = 70),
      t
    );
  })(Laya.Sprite);
  e.FightHeader = t;
})(Fight || (Fight = {}));
